<form class="form-horizontal" style="margin-top: 15px;">
  <div class="col-sm-12 form-section-title">
    更新配置
  </div>
  <!-- parallelism-input -->
  <div class="form-group">
    <label for="parallelism" class="col-sm-3 col-lg-2 control-label text-left">更新并行任务数</label>
    <div class="col-sm-4 col-lg-3">
      <input type="number" class="form-control" ng-model="formValues.Parallelism" id="parallelism" placeholder="例如：1" />
    </div>
    <div class="col-sm-5">
      <p class="small text-muted">
        同时更新的任务的最大数量（0为一次全部更新）。
      </p>
    </div>
  </div>
  <!-- !parallelism-input -->
  <!-- delay-input -->
  <div class="form-group">
    <label for="update-delay" class="col-sm-3 col-lg-2 control-label text-left">
      更新延迟
      <portainer-tooltip position="bottom" message="Supported format examples: 1h, 5m, 10s, 1000ms, 15us, 60ns."></portainer-tooltip>
    </label>
    <div class="col-sm-4 col-lg-3">
      <input type="text" class="form-control" ng-model="formValues.UpdateDelay" id="update-delay" placeholder="例如：1m" ng-pattern="/^([0-9]+)(h|m|s|ms|us|ns)$/i" />
    </div>
    <div class="col-sm-5">
      <p class="small text-muted">
        更新之间的时间间隔，用数字表示，支持的时间单位(ns|us|ms|s|m|h)。默认值为0s，0秒。
      </p>
    </div>
  </div>
  <!-- !delay-input -->
  <!-- failureAction-input -->
  <div class="form-group">
    <label for="failure-action" class="col-sm-3 col-lg-2 control-label text-left">更新失败的操作</label>
    <div class="col-sm-4 col-lg-3">
      <div class="btn-group btn-group-sm">
        <label class="btn btn-primary" ng-model="formValues.FailureAction" uib-btn-radio="'continue'">继续</label>
        <label class="btn btn-primary" ng-model="formValues.FailureAction" uib-btn-radio="'pause'">暂停</label>
      </div>
    </div>
    <div class="col-sm-5">
      <p class="small text-muted">
        失败时的操作顺序
      </p>
    </div>
  </div>
  <!-- !failureAction-input -->
  <!-- order-input -->
  <div class="form-group" ng-if="applicationState.endpoint.apiVersion >= 1.29">
    <label for="update-order" class="col-sm-3 col-lg-2 control-label text-left">更新顺序</label>
    <div class="col-sm-4 col-lg-3">
      <div class="btn-group btn-group-sm">
        <label class="btn btn-primary" ng-model="formValues.UpdateOrder" uib-btn-radio="'start-first'">最先启动</label>
        <label class="btn btn-primary" ng-model="formValues.UpdateOrder" uib-btn-radio="'stop-first'">最先停止</label>
      </div>
    </div>
    <div class="col-sm-5">
      <p class="small text-muted">
        失败时的操作顺序。
      </p>
    </div>
  </div>
  <!-- !order-input -->

  <div class="col-sm-12 form-section-title">
    重启策略
  </div>
  <!-- restartCondition-input -->
  <div class="form-group">
    <label for="restart-condition" class="col-sm-3 col-lg-2 control-label text-left">重启条件</label>
    <div class="col-sm-4 col-lg-3">
      <div class="btn-group btn-group-sm">
        <label class="btn btn-primary" ng-model="formValues.RestartCondition" uib-btn-radio="'none'">None</label>
        <label class="btn btn-primary" ng-model="formValues.RestartCondition" uib-btn-radio="'on-failure'">On-failure</label>
        <label class="btn btn-primary" ng-model="formValues.RestartCondition" uib-btn-radio="'any'">Any</label>
      </div>
    </div>
    <div class="col-sm-5">
      <p class="small text-muted">
        满足条件时重新启动的方式（默认条件为 "any"）。
      </p>
    </div>
  </div>
  <!-- !restartCondition-input -->
  <!-- restartDelay-input -->
  <div class="form-group">
    <label for="restart-delay" class="col-sm-3 col-lg-2 control-label text-left">
      重新启动延迟
      <portainer-tooltip position="bottom" message="Supported format examples: 1h, 5m, 10s, 1000ms, 15us, 60ns."></portainer-tooltip>
    </label>
    <div class="col-sm-4 col-lg-3">
      <input type="text" class="form-control" ng-model="formValues.RestartDelay" id="restart-delay" placeholder="例如：1m" ng-pattern="/^([0-9]+)(h|m|s|ms|us|ns)$/i" />
    </div>
    <div class="col-sm-5">
      <p class="small text-muted">
        重启尝试之间的延迟，用数字表示，支持的时间单位(ns|us|ms|s|m|h)。默认值为5s，5秒。
      </p>
    </div>
  </div>
  <!-- !restartDelay-input -->
  <!-- restartMaxAttempts-input -->
  <div class="form-group">
    <label for="restart-max-attempts" class="col-sm-3 col-lg-2 control-label text-left">重启最大尝试次数</label>
    <div class="col-sm-4 col-lg-3">
      <input type="number" class="form-control" ng-model="formValues.RestartMaxAttempts" id="restart-max-attempts" placeholder="例如：0" />
    </div>
    <div class="col-sm-5">
      <p class="small text-muted">
        给定任务在放弃前重启的最大尝试次数（默认值为0，表示无限制）。
      </p>
    </div>
  </div>
  <!-- !restartMaxAttempts-input -->
  <!-- restartWindow-input -->
  <div class="form-group">
    <label for="restart-window" class="col-sm-3 col-lg-2 control-label text-left">
      重启窗口
      <portainer-tooltip position="bottom" message="Supported format examples: 1h, 5m, 10s, 1000ms, 15us, 60ns."></portainer-tooltip>
    </label>
    <div class="col-sm-4 col-lg-3">
      <input type="text" class="form-control" ng-model="formValues.RestartWindow" id="restart-window" placeholder="例如：1m" ng-pattern="/^([0-9]+)(h|m|s|ms|us|ns)$/i" />
    </div>
    <div class="col-sm-5">
      <p class="small text-muted">
        评估重启尝试的时间窗口，用数字表示，支持的时间单位(ns|us|ms|s|m|h)。默认值为0秒，没有限制。
      </p>
    </div>
  </div>
  <!-- !restartWindow-input -->
</form>
